<template>
	<view class="m-2">
		<swiper :indicator-dots="true" indicator-active-color="#ffffff" autoplay circular style="height: 380rpx;"
			@change="getCurrentImgIndex">
			<swiper-item v-for="(item, index) in imgArr" :key="index">
				<image :src="item.src" mode="aspectFill" class="animated"
					:class="{'my-animate': currentImgIndex === index}"></image>
			</swiper-item>
		</swiper>
	</view>
</template>

<script>
	export default {
		name: "rotationChart",
		props: {
			imgArr: {
				type: Array,
				default: () => []
			}
		},
		data() {
			return {
				currentImgIndex: 0
			}
		},
		methods: {
			getCurrentImgIndex(e) {
				const {
					current
				} = e.detail;
				this.currentImgIndex = current;
			}
		}
	}
</script>

<style>

</style>
